
package ca.usask.cs.decisiontree.api;


/**
 * An Edge represents the path connecting two TreeNodes. It has a weight, 
 * which is the time difference between source and destination nodes. It has 
 * a probability, which is the liklihood that this path is chosen.
 * 
 * @invariant weight is a positive value
 * @invariant source node is not null
 * @invariant destination node is not null
 * 
 * @author SaskTrav
 * @editor Wenyi AN
 */
public interface Edge {
	/**
     * get the Type of Edge
     * @return  the Type name of the Edge
     */
	public String getEdgeType();
    /**
     * Identifies the Edge as selected or not
     * @return  True if selected
     *          False if not selected
     */
    public boolean isSelected();

    /**
     * Assigns the current Edge to selected or not selected
     * @questioin might convert to two functions, select/unselect
     */
    public void setSelected(boolean newSelect);

    /**
     * Retrieves the Path value of the edge
     * @return
     */
    public double getPathValue();

    /**
     * assigns the current edge with a path value
     * @param pathValue
     */
    public void setPathValue(double pathValue);

    /**
     * retrieves the edgeID of the edge
     * @return
     */
    public int getEdgeID();
    /**
     * retrieves the edgeID of the edge
     * @return
     */
    public String getEdgeName();
    /**
     * Retrieves the value of the specified attribute from the source node
     * @retrun A double value that represents the value of the specified
     * attribute from the source node
     */
    public double getValue();

    /**
     * Retrieve the TreeNode representing the source of this Edge.
     * 
     * @return A TreeNode at which the edge originates.
     * @see TreeNode
     */
    public TreeNode getSourceNode();
    
    /**
     * Retrieve the TreeNode representing the destination of this Edge.
     * 
     * @return A TreeNode at which the edge terminates.
     * @see TreeNode
     */
    public TreeNode getDestinationNode();

    /**
     * Retrieves the value of the specified attribute from the source node
     *
     * @postcondition getValue will return the value provided by theValue
     * @retrun A double value that represents the value of the specified
     * attribute from the source node
     */
    public void setValue(Double newValue);
        /**
     * Assign the TreeNode representing the source of this Edge.
     *
     * @see TreeNode
     */
    public void setSourceNode(TreeNode newSourceNode);

    /**
     * Assign the TreeNode representing the destination of this Edge.
     * @see TreeNode
     */
    public void setDestinationNode(TreeNode newDestinationNode);

        /**
     * Retrieve the edge weight between source and destination nodes.
     * A weight may be any positive value.
     *
     * @return A double-precision representation of the weight.
     */
    //double getWeight();

    
}
